<template>
  <div class="auto" style="margin-top: 10px;border: 1px solid #F2F6FA;">
    <criteria v-ref:criteria>
      <div novalidate class="form-horizontal" partial>
        <p class="flex-between bg-info" style="padding: 8px;">
          <span>抄表查询</span>
          <span class="btn btn-link add-postition" @click="$parent.clear()">清空查询条件</span>
        </p>
        <!-- <div class="form-group">
          <label class="control-label">抄表月份</label>
          <datepicker placeholder="抄表月份" width='100%'
            v-model="model.f_hand_date"
            :value.sync="model.f_hand_date"
            :disabled-days-of-Week="[]"
            :format="'yyyy-MM'"
            condition="all_抄表时间_18 >= '{}-01 00:00:00' and all_抄表时间_18 <= '{}-'"
            :show-reset-button="reset">
          </datepicker>
        </div> -->
        <div class="form-group">
          <label class=" col-sm-3 control-label">抄表状态</label>
          <div class="col-sm-9">
            <v-select :value.sync="model.f_meter_state"
                v-model="model.f_meter_state"
                :options='$parent.meterstate' placeholder='请选择'
                condition="all_抄表状态_18 = '{}'"
                close-on-select></v-select>
          </div>
        </div>
        <div class="form-group">
          <label class=" col-sm-3 control-label">抄表员</label>
          <div class="col-sm-9">
            <v-select :value.sync="model.f_inputtor"
                v-model="model.f_inputtor"
                :options='$parent.inputtor' placeholder='请选择'
                condition="all_抄表员_15 = '{}'"
                close-on-select></v-select>
          </div>
        </div>
        <div class="form-group">
          <label class=" col-sm-3 control-label">缴费状态</label>
          <div class="col-sm-9">
            <v-select :value.sync="model.f_whether_pay"
                v-model="model.f_whether_pay"
                :options='$parent.whetherPay' placeholder='请选择'
                condition="all_是否缴费_16 = '{}'"
                close-on-select></v-select>
          </div>
        </div>


      </div>
    </criteria>
  </div>
</template>

<script>
import AppData from '../../../../stores/AppData'
export default {
  title: '换表查询条件',
  methods: {
    getArgs () {
      return this.$refs.criteria.search()
    },
    // 清空所有查询条件
    clear () {
      Object.keys(this.$refs.criteria.model).forEach((key) => {
        this.$refs.criteria.model[key] = ''
      })
    }
  },
  computed: {
    meterstate () {
      return [{label: '全部', value: ''}, ...AppData.getParam('抄表状态')]
    },
    inputtor () {
      return [{label: '全部', value: ''}, ...AppData.getParam('抄表员')]
    },
    whetherPay () {
      return [{label: '全部', value: ''}, {label: '已缴费', value: '是'}, {label: '未缴费', value: '否'}]
    }
  }
}
</script>
